package server.core.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class FormatDate implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -2439859296455888043L;
	private SimpleDateFormat output = new SimpleDateFormat("dd MMMM yyyy HH:mm");
	private Calendar date = GregorianCalendar.getInstance();

	/**
	 * @param d - Day
	 * @param M - Month
	 * @param y - Year
	 * @param H - Hour
	 * @param m - Minute
	 */
	public FormatDate(int d, int M, int y, int H, int m) {
		this.date.clear();
		this.date.set(y, M, d, H, m);
	}
	/**
	 * @param d - Day
	 * @param M - Month
	 * @param y - Year
	 */
	public FormatDate(int d, int M, int y) {
		this.date.clear();
		this.date.set(y, M, d);
	}
	/**
	 * @param date of Date
	 */
	public FormatDate(Date date){
		this.date.clear();
		this.date.setTime(date);
	}
	
	public FormatDate(int H, int m){
		this.date.clear();
		this.date.set(0, 0, 0, H, m, 0);
	}

	public FormatDate(Calendar date) {
		this.date=date;
	}
	public String toString() {
		return output.format(date.getTime());
	}
	public Calendar getDate(){
		return this.date;
	}
	

	
}
